The present invention relates to a demultiplexing and decoding apparatus which receives multiplex packet data, formed by compressing and encoding video data and audio data by high-efficiency coding means and packetizing and multiplexing the compressed and coded data, and more particularly, to a demultiplexing and decoding apparatus which demultiplexes the multiplex packet data and decodes necessary code data.
For handling an video signal and an audio signal (hereinafter referred to xe2x80x9cA/V dataxe2x80x9d) in digital satellite broadcasting, cable television and the like, a coding method for digital-coding the audio/video signal to reduce spatial and temporal redundancy to reduce the amount of data is widely used. As an example of this high efficiency coding means, a so-called MPEG method standardized by ISO/SC29/WG11 is well known. In the MPEG method, the code data multiplexing is also standardized in the ISO/IEC13818-1: 1994xe2x80x9cInformation Technologyxe2x80x94Coding of Moving Pictures and Associated Audioxe2x80x94Part 1: Systemsxe2x80x9d.
FIG. 11 shows an example of a transport stream (TS) defined in the MPEG system.
In FIG. 11(a), data in the TS is included in a 188-byte fixed-length packet called a TS packet. Upon actual transmission, error-correcting codes are added to the TS packet.
The TS packet has a header which begins from a 1-byte sync word and a 13-bit packet identifier (PID). The subsequent part is called a xe2x80x9cpayloadxe2x80x9d including transfer data. Further, an extension header called xe2x80x9cadaptation fieldxe2x80x9d is added immediately subsequent to the header, in accordance with necessity. The adaptation field includes program clock reference (PCR) data necessary for reproduction of a system clock and the like.
On the receiving side, the system clock is reproduced by interpreting the PCR data. This realizes a system where the clock frequency is locked with the transmitting side, in which decoding time, output time and buffering speed can be managed in accordance with the assumption by the transmitting side.
The payload includes a program element such as A/V data of a program, as shown in FIG. 11(b), or includes additional information such as PSI (Program Specific Information) data indicative of packet multiplex status and a program table, as shown in FIG. 11(c) . The payload of each packet is a data portion of continuous data as shown in FIG. 11(b) or 11(c) (indicated with a broken line in association with FIG. 11(a)).
In a case where the payload is as shown in FIG. 11(b) the stream of the coded program element is packetized (this stream is referred to as a xe2x80x9cPES (Packetized Elementary Stream) packetxe2x80x9d, and the header of the PES packet includes data indicative of the type of program element, data indicative of the PES packet length, and DTS (Decoding Time Stamp) data indicative of time at which the program element is to be decoded, PTS (Presentation Time Stamp) data indicative of time at which the decoded program element is to be presented, and the like.
Further, as the program element, closed caption data to superimpose subtitle information on a decoded video image in accordance with an audience""s request, additional A/V data outputted in synchronization with the decoded A/V signal and the like are used as well as the above-described program A/V data. These program elements are outputted in controlled output timing based on the PTS data.
In a case where the payload is as shown in FIG. 11(c), the additional information is divided in section units, and data is formatted for each section. Necessary PSI data and other additional information can be obtained by interpretation in accordance with the format.
The PSI data has a hierarchical table structure, and includes PMT (Program Map Table) data where the correspondence between the element and the PID data is described for each program, PAT (Program Association Table) data where the correspondence between the PMT data and the PID data is described, and the like.
Further, a received TS packet may be encrypted such that a particular audience can decode the data. In this case, descrambling key information and the like are transmitted in section units. Such descrambling information may be ECM (Entitlement Control Message) data including descrambling key information for each program, EMM (Entitlement Management Message) data including individual receiving-machine based descrambling key information, CAT (Conditional Access Table) data indicative of the correspondence between the ECM data and each program, or the like.
Generally, as the additional information, data called electronic program guide (EPG) or the like managed in section units is transmitted. On the receiving machine side, a graphical user interface (GUI) for program selection by a user is constructed or a program reservation system is constructed by visualizing the information and outputting the information to a display screen.
Examples of a system to receive a transport stream (TS), modulated and transmitted via a medium such as CATV or digital satellite broadcasting, and to demultiplex and decode the received TS are disclosed in Japanese Patent Application Laid-Open Nos. 8-275151 and 8-265746.
FIG. 12 is a block diagram showing an example of a conventional demultiplexing and decoding apparatus for coded A/V data. In FIG. 12, reference numeral 1 denotes an input terminal; 2, a demodulator-FEC decoder; 3, a transport demultiplexer; 30, a descrambler; 31, a PID filter; 32, an A/V buffer; 33, a decoder I/F, 34, a PST buffer; 35, a bus I/F; 36, a PID table, 37, an STC (System Time Clock) counter; 4, an audio decoder; 5, a video decoder; 6, a CPU; 7, a RAM; 71, a working area; 72, a TS packet buffer area; 8, a ROM; 9, a system clock generator; 10, a user I/F; 11, an OSD processor; 12 and 13, DAC""s (Digital-to-Analog Converters); and 14 and 15, output terminals.
In FIG. 12, a signal tuned to a desired channel by means which is not shown, and received by an antenna or the like, is inputted from the input terminal 1 and supplied to the demodulator-FEC decoder 2. The demodulator-FEC decoder 2 decodes the input signal and performs error correction using the error correction codes in the transport stream, and supplies the signal to the transport demultiplexer 3. In the error-corrected transport stream, a plurality of programs are multiplexed.
In the transport demultiplexer 3, the descrambler 30 appropriately performs descrambling on the supplied transport stream, and supplies the transport stream to the PID filter 31. In the PID filter, a packet including a set of A/V element corresponding to a desired program, desired PSI and an additional information signal are selected and extracted. Upon packet extraction, data within the PID table 36, in which PID""s to be selected are set, are sequentially read out, and one PID coincides with the PID of the input TS packet is selected.
Among the input TS packets, a program provided only to a particular audience or the like is encrypted. The descrambler 30 descrambles the encryption. Further, a TS packet including PCR data is transferred from the PID filter 31 to the STC counter 37. The STC counter 37 counts the STC initialized with the PCR by the system clock, and outputs a control signal to the system clock generator 9 such that the difference from the sequentially-arriving PCR data is reduced. The system clock generator 9 generates a system clock as a system control reference clock based on the control signal.
Among the packets demultiplexed by the PID filter 31, a packet including coded A/V data as a desired program element is temporarily stored in the A/V buffer 32, and transferred via the decoder I/F 33 to the audio decoder 4 and the video decoder 5. The audio decoder 4 decodes the supplied coded audio data in accordance with the MPEG method, and outputs the data as a digital audio signal. The video decoder 5 decodes the supplied coded video data in accordance with the MPEG2 method, and outputs the data as a digital video signal. These digital audio signal and digital video signal are respectively converted by the DAC""s 12 and 13 into analog audio signal and analog video signal, and supplied from the output terminals 14 and 15 to a speaker (not shown) and a monitor (not shown), and recognized by the audience.
Among the packets demultiplexed by the PID filter 31, a packet including PSI data and additional information is supplied via the PSI buffer 34 and the bus I/F 35 to the RAM 7, and stored into an assigned TS packet buffer area 72. The packet stored in the TS packet buffer area 72 is read by the CPU 6 in the order of arrival, and interpreted in accordance with a program stored in the ROM 8. Further, the information managed in section units is divided in section units in the working area 71 of the RAM 7, and stored as PSI information and EPG information.
For example, when program selection is performed, the CPU 6 forms a display image of a program table, and sends the image via the data bus to the OSD processor 11. The user selects a program while watching the displayed program table by using a remote controller, and information from the remote controller is sent from the user I/F 10 to the CPU 6. The PID of a packet necessary for the selected program is selected based on the PSI information stored in the working area 71. The selected PID is written via the bus I/F 35 into the PID table 36. Then the program designated by the user is demultiplexed by the PID filter 31 and decoded as described above.
In the above conventional apparatus, the TS packet to be processed by the CPU 6 is stored in the TS packet buffer 72. FIG. 13 shows an example of the TS packet buffer 72 having a ring buffer structure for storing M TS packets.
In FIG. 13, the inside of the TS packet buffer is managed by a packet-based address (hereinafter, referred to as a xe2x80x9crow addressxe2x80x9d). The TS packets demultiplexed and extracted by the PID filter 31 (FIG. 12) are written, in the order of arrival, into the row addresses arrayed in accordance with the order of increasing value of the TS packet buffer. Assuming that M row addresses from 0, 1, 2, . . . , (Mxe2x88x921) are set in the TS packet buffer, when the row address is the last address (Mxe2x88x921), TS packets arrive after the writing into the row address (Mxe2x88x921) are sequentially written from the initial address 0. On the other hand, the stored TS packet is read by the CPU 6 (FIG. 12), and subjected to interpretation and processing corresponding to the data. When the interpretation of one packet has been completed, the next TS packet is read from the next row address, and similarly processed by the CPU 6. The order of reading the TS packets from the TS packet buffer is the same as that of writing. Further, in a case where the reading address catches up with the writing address, reading is stopped and interpretation is not performed until a TS packet is newly stored.
In the above conventional apparatus, as the TS packets are processed in the order of arrival, as described above, even though a TS packet to be processed prior to other packets is stored in the TS packet buffer 72, reading from the address where this TS packet is stored cannot be performed until interpretation processing have been performed on all the TS packets which arrived earlier than this TS packet.
For example, subtitle information where the presentation time or the like is designated by the PTS data must be processed prior to the other information such as EPG information. On the other hand, upon program selection or program reservation, for high-speed access to program table data for several days, a large amount of EPG information must be stored in the memory in advance. Accordingly, in this case, a large number of TS packets related to the EPG information are stored into the TS packet buffer 72 at once.
In this case, as shown in FIG. 13, a large number of TS packets having the EPG data are stored from the current reading position (row address) to a position immediately prior to the row address (Mxe2x88x924) where the subtitle information is stored. If the period of interpretation of the respective EPG data is prolonged, the subtitle information cannot be displayed at desired time.
The present invention has an object to remove the above problem, and to provide a demultiplexing and decoding apparatus for receiving coded audio and video data with a simple circuit construction, which processes a TS packet having higher priority over other packets prior to other packets, regardless of the order of arrival of the packets, thus performs interpretation on additional information and packet multiplexing information without breaking system control.
To attain the above object, the present invention provides a construction comprising: a demultiplexer which selects a packet including one set of compressed bitstream from a multiplexed stream formed by packetizing a plurality of compressed bitstreams, each comprising coded video data and coded audio data, and packet multiplexing information and additional information, and further, selects a packet including a part or all of said packet multiplexing information and said additional information; a video decoder which decodes a video data from the selected compressed bitstream; an audio decoder which decodes audio data from the selected compressed bitstream; a CPU which interprets said selected packet multiplexing information and controls said video decoder, said audio decoder and said demultiplexer; a program memory for storing a program in which a procedure by the CPU is described; a packet buffer for temporarily storing said packet including said selected packet multiplexing information and said additional information until said packet is processed by said CPU; and means for dividing said packet buffer into data segment storage areas, for which priority is set, in accordance with types of data included in said packet, when said packet is stored into said packet buffer memory, and for processing packets stored in said data segment storage areas in accordance with the priority.
Further, the above storage areas are respectively divided for PID""s of the packets, and the apparatus further comprises means for determining a TS packet writing address by informing the CPU of an index number of a PID table referred by the demultiplexer upon packet demultiplex selection such that the CPU refers to an address table with the index number.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same name or similar parts throughout the figures thereof.